<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<c:set var="nature_value">
	<x:out
		select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" />
</c:set>


<div style="margin-bottom: 5px;">
    		<strong>温馨提示：</strong><br/>
    		<security:authorize ifNotGranted="A_DAILU_PROPOSAL">
    		单位信息从【单位维护表】中导入，由单位管理员填写，如有疑问请联系单位管理员进行修改。 
    		</security:authorize>
    		<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
    		单位信息从【单位维护表】中导入，如有数据需要调整，请您到【系统管理】->【单位信息维护】功能进行修改 。
    		</security:authorize>
</div>



<div class="t_bar">单位基本情况</div>
<table class="t_css" width="100%" border="0" cellpadding="0" id="orgInfo" cellspacing="1">
	<col width="20%"/>
	<col width="30%"/>
	<col width="20%"/>
	<col width="30%"/>
	<tr>
		<td  align="right" nowrap>单位名称：</td>
		<td colspan="3"> 
			<span name="organizations/organization[0]/org_name">
				<x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" />
		    </span>
		</td>
	</tr>
	<tr>
		<td align="right" >单位地址：</td>
		<td colspan="3"> 
		    	<span name="organizations/organization[0]/address_org"> 
			    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address" /> 
		     </span>
		</td>
	</tr>
	 
	<tr>
		<td align="right">邮政编码：</td>
		<td>  
		    <span name="organizations/organization[0]/zip_code">
		         <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/zip_code" /> 
		    </span>
		</td>
		<td align="right">联系电话：</td>
		<td> 
		    <span name="organizations/organization[0]/org_tel"> 
			    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_tel" /> 
		    </span>
		</td>
	</tr>
	 
</table>

	<div class="t_bar">单位人员情况（单位：人）</div>
	<table class="t_css" width="100%" border="0" cellpadding="0" id="orgInfo2" cellspacing="1">
			<col width="20%"/>
			<col width="30%"/>
			<col width="20%"/>
			<col width="30%"/>
		<tr>
			<td  align="right" nowrap>职工总数：</td>
			<td colspan="1" align="center"> 
				<span name="organizations/organization[0]/people_count_total">
					<x:out select="$xmlData/data/organization_persons/people_count_total" />
			    </span>
			</td>
			<td nowrap align="right"  >大专以上人员数：</td>
			<td colspan='1' align="center">
		    <span name="organizations/organization[0]/degree_total" id="degree_total"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/degree_total" /></span> 
		    <input type="hidden" id='degree_college' value="<x:out select='$xmlData/data/organization_persons/degree_college' />">
		    <input type="hidden" id='degree_bachelor' value="<x:out select='$xmlData/data/organization_persons/degree_bachelor' />">
		    <input type="hidden" id='degree_master' value="<x:out select='$xmlData/data/organization_persons/degree_master' />">
		    <input type="hidden" id='degree_doctor' value="<x:out select='$xmlData/data/organization_persons/degree_doctor' />">
		    <script type="text/javascript">
	           $(function() {
		             var degree_college=$("#degree_college").val();
		             if(degree_college=="" || 1==1) // 大专以上人员数 此项不统计
		            	 degree_college=0;
		             var degree_bachelor=$("#degree_bachelor").val();
		             if(degree_bachelor=="")
		            	 degree_bachelor=0;
		             var degree_master=$("#degree_master").val();
		             if(degree_master=="")
		            	 degree_master=0;
		             var degree_doctor=$("#degree_doctor").val();
		             if(degree_doctor=="")
		            	 degree_doctor=0;
		             var count=parseInt(degree_college)+parseInt(degree_bachelor)+parseInt(degree_master)+parseInt(degree_doctor);
		             $("#degree_total").text(count);
	           });
            </script>
		</td>
		</tr>
		
			<tr>
			<td  align="right" nowrap>管理人员数：</td>
			<td colspan="1" align="center"> 
				<span name="organizations/organization[0]/work_xingzheng">
					<x:out select="$xmlData/data/organization_persons/work_xingzheng" />
			    </span>
			</td>
			<td nowrap align="right">研究开发人员数：</td>
			<td colspan='1' align="center">
		    <span name="organizations/organization[0]/work_yanfa">
		   	 <x:out select="$xmlData/data/organization_persons/work_yanfa" />
		    	</span>
		</td>
		</tr>
		
	</table>	
	
	<c:if test="${fn:substring(nature_value,0,1)=='A' }">
		<div class="t_bar">上年度主要产品情况</div>
		<table id="product_last_year" class="t_css" width="100%" border="0" cellpadding="0" id="orgInfo3" cellspacing="1">
			<thead>
				<th width="20%">序号</th>
				<th width="50%">主要产品</th>
				<th width="30%">占企业销售收入比例(%)
			<%-- 	<input id="income" type="text" value="<x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/income"/>" /> --%>
				</th>
			</thead>
			
			
			<c:set value="0" var="index" scope="page"/>
		   <x:forEach select="$xmlData/data/product/goods" var="product">
						<c:choose>
							<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
							<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
						</c:choose>
						<tr >
							<td align="center">&nbsp;
								<span name="products/product[${flag}${index}]@seq_no" ><x:out select="$product/@sequence_no"/></span> 
							</td>
							<td>
								<span name="products/product[${flag}${index}]/name" ><x:out select="$product/gname" /></span>
							</td>
							<td align="center">
								<input type="hidden" value="<x:out select="$product/income" />"/>		
							  <span name="products/product[${flag}${index}]/income_rate">
							  
							  </span>
							</td> 
						</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
	       </x:forEach>
		</table>
	</c:if>
		
<c:if test="${fn:substring(nature_value,0,1)!='A' }">
<div class="t_bar"><span class="color_red">*</span>
<span id="lastyear_pro">上年度主要产品情况</span>
</div>

<table class="table01" width="100%" border="0" cellpadding="0"
	id="tblProduct" cellspacing="1">
    <thead>
		<tr>
			<th class="TblHead" align="center" width="10%" nowrap>选择</th>
			<th class="TblHead" align="center" width="10%" nowrap>序号</th>
			<th class="TblHead" align="center" width="40%" nowrap>主要产品</th>  
			<th class="TblHead" align="center" width="20%" nowrap>
				<span id="zhan_pro">占企业销售收入比例（%）</span>
			</th>
		</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none">
						<td style="text-align:center;"><input type="radio" class="radiobutton" name="selProduct" >
						</td>
						<td style="text-align:center;"><span name="products|product[0]@seq_no" >[index]</span> 
						</td>
						<td style="text-align:center;"><input type="text" style="width:90%" name="products|product[0]|name" class="input_text required" 
							maxlength=50 label="主要产品" value=""/></td>
						
						<td style="text-align:center;"><input id='input_only' type="text" size="35" name="products|product[0]|income_rate" class="input_text required" 
							style="text-align:right;width:100px"  
							label="占企业销售收入比例" onfocus="InitInput.setNumber(this,3,2,2)" value="" /></td>
					</tr>
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/products/product" var="product">
					<c:choose>
						<c:when test="${index<10}" >
						<c:set value="0" var="flag" scope="page"/>
						</c:when>
						<c:otherwise>
						<c:set value="" var="flag" scope="page"/>
						</c:otherwise>
					</c:choose>
					<tr>
						<td style="text-align:center;"><input type="radio" class="radiobutton" name="selProduct" ></td>
						<td style="text-align:center;"><span name="products/product[${flag}${index}]@seq_no" >${index+1}</span></td>
						<td style="text-align:center;"><input type="text"  name="products/product[${flag}${index}]/name" 
							class="input_text required" maxlength=68 label="主要产品" style="width:90%" 
							value="<x:out select="$product/name" />" /></td>
						<td style="text-align:center;"><input id='input_only' type="text"  name="products/product[${flag}${index}]/income_rate" 
							class="input_text required" label="占企业销售收入比例"  size="35"
							style="text-align:right;width:100px"  
							onfocus="InitInput.setNumber(this,3,2,2)"
							value="<x:out select="$product/income_rate" />" /></td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
				</tbody>
			</table>
			<table width="98%" align="center">
				<tr>
					<td>
					
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="addNewRow('tblProduct');try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblProduct','selProduct')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblProduct','selProduct')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblProduct','产品情况');">
					</td>
				</tr>
	        </table>
	</c:if>
		
		
		<script type="text/javascript">
				var income_total = '<x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/income"/>';
				var income = 0 ;
				$(document).ready(function(){
					$("#product_last_year").find("span[name$='income_rate']").each(function(){
						income_total=income_total.replace(/,/g,"");
						var income_temp = $(this).prev().val().replace(/,/g,"");
						
						if (income_total == 0 ||  income_total == 0.00 ){
							$(this).text("0.00");
						} 
						
						if (!isNaN(income_temp) && !isNaN(income_total) && income_total != 0 &&  income_total != 0.00 ){
							income = income_temp;
							$(this).text(formatVal(income*100/income_total));
						} 
					});
				});
		
		</script>

<input type="hidden" name="organization/finances/finance[0]@sequence_no" value="5"/>
	<c:if test="${fn:substring(nature_value,0,1)=='A' }">
		<div class="t_bar">上年度生产经营情况（万元）</div>
		<table class="t_css" width="100%" border="0" cellpadding="0" id="orgInfo2" cellspacing="1">
		<col width="20%"/>
		<col width="30%"/>
		<col width="20%"/>
		<col width="30%"/>
			<tr>
				<td  align="right" nowrap>总收入：</td>
				<td colspan="1" align="center" > 
					
					 <span name="organization_finances/finance/income">
						 <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/income"/>
				    </span>
				</td>
				<td nowrap align="right"   >净利润：</td>
				<td colspan="1" align="center" > 
					 <span name="organization_finances/finance/proft">
						 <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/proft"/> 
				    </span>
				</td>
		 </tr>
		 <tr>
				<td  align="right" nowrap>总产值：</td>
				<td colspan="1" align="center" > 
					 <span name="organization_finances/finance/output">
						 <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/output"/> 
				    </span>
				</td>
				<td nowrap align="right"   >纳税总额：</td>
				<td colspan="1" align="center" > 
					 <span name="organization_finances/finance/fax">
						 <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/fax"/> 
				    </span>
				</td>
		 </tr>
		  <tr>
				<td  align="right" nowrap>增加值：</td>
				<td colspan="1" align="center" > 
					 <span name="organization_finances/finance/added">
						 <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/added"/> 
				    </span>
				</td>
				<td nowrap align="right"   >创汇总额（万美元）：</td>
				<td colspan="1" align="center" > 
					 <span name="organization_finances/finance/export">
						 <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/export"/> 
				    </span>
				</td>
		 </tr>
		   <tr>
				<td  align="right" nowrap>产品销售收入：</td>
				<td colspan="1" align="center" > 
					 <span name="organization_finances/finance/sales_revenue">
						 <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/sales_revenue"/> 
				    </span>
				</td>
				<td nowrap align="right"   >研发经费支出总额：</td>
				<td colspan="1" align="center" > 
					 <span name="organization_finances/finance/yanfa_income">
						 <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/yanfa_income"/> 
				    </span>
				</td>
		 </tr>
		 </table>
	</c:if>

<c:if test="${fn:substring(nature_value,0,1)!='A' }">
<div class="t_bar"><span class="color_red">*</span>
<span id="lastyear_jinyin">上年度生产经营情况（万元）</span>
</div>

		<table class="t_css" width="100%" border="0" cellpadding="0" id="orgInfo4" cellspacing="1">
		<col width="20%"/>
		<col width="30%"/>
		<col width="20%"/>
		<col width="30%"/>
			<tr>
				<td  align="right" nowrap>总收入：</td>
				<td colspan="1" align="center" > 
					<input id="income" name="organization_finances/finance/income" onfocus="InitInput.setNumber(this,7,4,2)" label="总收入" type="text" required class="required input_text maxlength:100"  style="text-align: right; width: 100px;" maxlength="100" value="<x:out select="$xmlData/data/organization_finances/finance/income" />"/> 
				</td>
				<td nowrap align="right"   >净利润：</td>
				<td colspan="1" align="center" > 
					<input id="proft" name="organization_finances/finance/proft" onfocus="InitInput.setNumber(this,7,4,2)" label="净利润" type="text" required class="required input_text maxlength:100"  style="text-align: right;width: 100px;" maxlength="100" value="<x:out select="$xmlData/data/organization_finances/finance/proft" />"/> 
				
				</td>
		 </tr>
		 <tr>
				<td  align="right" nowrap>总产值：</td>
				<td colspan="1" align="center" > 
					<input id="output" name="organization_finances/finance/output" onfocus="InitInput.setNumber(this,7,4,2)"  label="总产值" type="text" required class="input_css required maxlength:100"  style="text-align: right;width: 100px;" maxlength="100" value="<x:out select="$xmlData/data/organization_finances/finance/output" />"/> 
				
				</td>
				<td nowrap align="right"   >纳税总额：</td>
				<td colspan="1" align="center" > 
					<input id="fax" name="organization_finances/finance/fax" onfocus="InitInput.setNumber(this,7,4,2)"  label="纳税总额" type="text" required class="input_css required maxlength:100"  style="text-align: right;width: 100px;" maxlength="100" value="<x:out select="$xmlData/data/organization_finances/finance/fax" />"/> 
					
				</td>
		 </tr>
		  <tr>
				<td  align="right" nowrap>增加值：</td>
				<td colspan="1" align="center" > 
					<input id="added" name="organization_finances/finance/added" onfocus="InitInput.setNumber(this,7,4,2)"  label="增加值" type="text" required class="input_css required maxlength:100"  style="text-align: right;width: 100px;" maxlength="100" value="<x:out select="$xmlData/data/organization_finances/finance/added" />"/> 
				
				</td>
				<td nowrap align="right"   >创汇总额（万美元）：</td>
				<td colspan="1" align="center" > 
					<input id="export" name="organization_finances/finance/export" onfocus="InitInput.setNumber(this,7,4,2)"  label="创汇总额（万美元）" type="text" required class="input_css required maxlength:100"  style="text-align: right;width: 100px;" maxlength="100" value="<x:out select="$xmlData/data/organization_finances/finance/export" />"/> 
					 
				</td>
		 </tr>
		   <tr>
				<td  align="right" nowrap>产品销售收入：</td>
				<td colspan="1" align="center" > 
					<input id="sales_revenue" name="organization_finances/finance/sales_revenue" onfocus="InitInput.setNumber(this,7,4,2)"  label="产品销售收入" type="text" required class="input_css required maxlength:100"  style="text-align: right;width: 100px;" maxlength="100" value="<x:out select="$xmlData/data/organization_finances/finance/sales_revenue" />"/> 
					
				</td>
				<td nowrap align="right"   >研发经费支出总额：</td>
				<td colspan="1" align="center" > 
					<input id="yanfa_income" name="organization_finances/finance/yanfa_income" onfocus="InitInput.setNumber(this,7,4,2)"  label="研发经费支出总额" type="text" required class="input_css required maxlength:100"  style="text-align: right;width: 100px;" maxlength="100" value="<x:out select="$xmlData/data/organization_finances/finance/yanfa_income" />"/> 
				</td>
		 </tr>
		 </table>
	</c:if>

		 
